<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>配型信息</title>
    <link rel="stylesheet" href="/WebYiZhi/Template/Home/Css/bootstrap.css"/>
<link rel="stylesheet" href="/WebYiZhi/Template/Home/Css/icheck.css"/>
<script src="/WebYiZhi/Template/Home/Js/jquery-2.1.1.js"></script>
<script src="/WebYiZhi/Template/Home/Js/bootstrap.js"></script>
<script type="text/javascript" src="/WebYiZhi/Public/Framework/hui/lib/jquery.form/3.46.0/jquery.form.js"></script>
<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js"></script>
<script>DD_belatedPNG.fix('.pngfix,.icon');</script>
<![endif]-->
<!--[if lt IE 9]>
<script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>

<![endif]-->
<script src="/WebYiZhi/Public/layer/layer.js"></script>
<!--自己的css-->
<link rel="stylesheet" href="/WebYiZhi/Template/Home/Css/login.css"/>
<link rel="stylesheet" href="/WebYiZhi/Template/Home/Css/style.css"/>
<script src="/WebYiZhi/Template/Home/Js/message.js"></script>
<script type="text/javascript" src="/WebYiZhi/Template/Home/Js/Validform_v5.3.2_min.js"></script>
<link rel="stylesheet" href="/WebYiZhi/Template/Home/Css/index.css"/>
<script src="/WebYiZhi/Template/Home/Js/Chart.js"></script>
<script src="/WebYiZhi/Template/Home/Js/Chart-1.0.1-beta.4.js"></script>
<script src="/WebYiZhi/Template/Home/Js/index.js"></script>
<script type="text/javascript" src="/WebYiZhi/Public/Framework/hui/lib/My97DatePicker/WdatePicker.js"></script>

</head>
<body>
<div class="container match">
    <p class="m_cont_info  text-center">配型信息</p>
    <form class="m_cont_big" id="mathing">
        <input type="hidden" name="patientid" value="4">
        <div class="row">
            <div class="form-group col-xs-6">
                <label class="col-xs-3 control-label">供者姓名：</label>
                <div class="col-xs-9">
                    <input type="text"  name="commonid" class="form-control" id="commonid" autocomplete="off" placeholder="请输入供者姓名">
                </div>
            </div>
            <div class="form-group col-xs-6 none">
                <label class="col-xs-3 control-label">性别：</label>
                <div class="col-xs-9">
                     <span class="select-box">
                        <select class="select form-control" size="1" name="sex">
                            <option  selected disabled>请选择</option>
                            <option value="1" >男</option>
                            <option value="0">女</option>
                        </select>
                     </span>
                </div>
            </div>
        </div>
        <!--////-->
        <div class="row block">
            <div class="form-group col-xs-6">
                <label class="col-xs-3 control-label">手术医院：</label>
                <div class="col-xs-9">
                     <span class="select-box">
                        <select class="select form-control" size="1" name="hospitalid">
                                    <option value="" selected="" disabled="disabled">请选择</option>
                        <?php $_result=getLists(hospitalinfo);if(is_array($_result)): $i = 0; $__LIST__ = $_result;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><option value="<?php echo ($v["id"]); ?>"><?php echo ($v["name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                        </select>
                   </span>
                </div>
            </div>
            <div class="form-group col-xs-6">
                <label class="col-xs-3 control-label">手术时间：</label>
                <div class="col-xs-9">
                    <input type="text" class="form-control"  name="operationtime" onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd HH:mm:ss' })" autocomplete="off" placeholder="请输入"  value="" >
                </div>
            </div>
        </div>
        <!--/////-->
        <div class="row none">
            <div class="form-group col-xs-6">
                <label class="col-xs-3 control-label">出生日期：</label>
                <div class="col-xs-9">
                    <input type="text" class="form-control"  name="birthday" onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd HH:mm:ss' })" autocomplete="off" placeholder="请选择患者出生日期"  value="" >
                </div>
            </div>
            <div class="form-group col-xs-6">
                <label class="col-xs-3 control-label">血型：</label>
                <div class="col-xs-9">
                    <select class="select form-control" size="1" name="bloodid"  >
                        <option value="" selected="" disabled="disabled">请选择</option>
                        <?php $_result=getLists(bloodtypeinfo);if(is_array($_result)): $i = 0; $__LIST__ = $_result;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><option value="<?php echo ($v["id"]); ?>"><?php echo ($v["name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                    </select>
                </div>
            </div>

        </div>

        <div class="row none">
            <div class="form-group col-xs-6">
                <label class="col-xs-3 control-label">死亡原因：</label>
                <div class="col-xs-9">
                     <span class="select-box">
                        <select class="select form-control" size="1" name="params">
                            <option value="病逝">病逝</option>
                            <option value="外力作用">外力作用</option>
                        </select>
                   </span>
                </div>
            </div>
            <div class="form-group col-xs-6">
                <label class="col-xs-3 control-label">原发病：</label>
                <div class="col-xs-9">
                     <span class="select-box">
                        <select class="select form-control" size="1" name="primarydiseaseid">
                        <option value="" selected="" disabled="disabled">请选择</option>
                            <?php $_result=getLists(diseaseinfo);if(is_array($_result)): $i = 0; $__LIST__ = $_result;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><option value="<?php echo ($v["id"]); ?>"><?php echo ($v["name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                        </select>
                   </span>
                </div>
            </div>
        </div>

        <div class="row m_tbtn">
            <p class="col-xs-1">HLA</p>
            <div class="col-xs-2">
                <input type="button" class="form-control" autocomplete="off" value="检测错配数" onclick="detection()" style="background: #00b683;border: 1px solid #00b683">
             </div>
        </div>
        <div class="row m_table">
            <table class="table table-bordered text-center">
                <tr class="bg-success">
                    <td>名称/项目</td>
                    <td>A1</td>
                    <td>A2</td>
                    <td>B1</td>
                    <td>B2</td>
                    <td>DR1</td>
                    <td>DR2</td>
                    <td>DQ1</td>
                    <td>DQ2</td>
                </tr>
                <tr>
                    <td>受体</td>
                    <?php $__FOR_START_8378__=1;$__FOR_END_8378__=9;for($i=$__FOR_START_8378__;$i < $__FOR_END_8378__;$i+=1){ ?><td><input type="text"  id="left<?php echo ($i); ?>"  name="value[left<?php echo ($i); ?>]"    placeholder=""/></td><?php } ?>
                </tr>
                <tr>
                    <td>供体</td>
                    <?php $__FOR_START_17341__=1;$__FOR_END_17341__=9;for($i=$__FOR_START_17341__;$i < $__FOR_END_17341__;$i+=1){ ?><td><input type="text"  id="right<?php echo ($i); ?>"  name="value[right<?php echo ($i); ?>]"    placeholder=""/></td><?php } ?>
                </tr>
                <tr>
                    <td>错配数</td>
                    <td colspan="8"><input id="errorsize" name="value[errorsize]" type="text" /></td>
                </tr>
            </table>
        </div>
        <div class="row m_tbtn p_linba">
            <p class="col-xs-3">淋巴毒实验</p>
            <p class="col-xs-2">阴性</p>
            <p class="col-xs-2"><input type="text" name="value[linbasize]" placeholder=""/></p>
            <p class="col-xs-2">%</p>
        </div>
        <div class="row m_tbtn p_pra">
            <p class="col-xs-3" style="margin-top: 15px">PRA（群体反应性抗体）</p>
            <div class="col-xs-9">
                <table class="table table-bordered col-xs-7 text-center">
                    <tr>
                        <td>I类</td>
                        <td><input type="text" name="value[lkind]" placeholder=""/></td>
                        <td>%</td>
                    </tr>
                    <tr>
                        <td>II类</td>
                        <td><input type="text"   name="value[llkind]" placeholder=""/></td>
                        <td>%</td>
                    </tr>
                </table>
            </div>
        </div>
        <div class="row p_submit">
            <div class="col-xs-offset-4 col-xs-2">
                <input type="button" onclick="mathing()" value="提交"/>
            </div>
            <div class="col-xs-offset-1 col-xs-2">
                <input type="submit" value="关闭" onclick="colses()"/>
            </div>
        </div>
    </form>
</div>
</body>
<script>
    layer.alert('请先输入供者姓名进行检测,以保证数据的准确性！');
    function colses() {
        parent.layer.closeAll()
    }
    function detection() {
        var j=0;
        for (var i=1; i<9; i++){
           var l=$('#left'+i) .val();
           var r=$('#right'+i) .val();
            if(l==r){
                 j=j;
            }else{
                j=j+1;
            }
        }
       $("#errorsize").val(j)
    }
    /**
     * 提交配型信息
     */
    function  mathing() {
        if(!$("#commonid").val()){
            layer.msg('请提供供者信息！',{time:1000});
         }else{
            $.ajax({
                url:"<?php echo U(patientmatching);?>",
                data:$('#mathing').serialize(),
                type:"Post",
                dataType:"json",
                success:function (data) {
                    if(data.status==1){
                        layer.msg(data.msg,{time: 1000}, function () { colses();});
                    }else{
                        layer.msg(data.msg);
                    }
                },
                error:function (err) {
                    layer.msg('服务器异常，请稍后在操作！');

                }
            })
        }

    }
</script>
</html>